home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume6 / conquer4 / patch4a < prev    next >
Encoding:
Internet Message Format  |  1989-08-08  |  55.4 KB

  1. Path: uunet!zephyr.ens.tek.com!tekgen!tekred!saab!billr
  2. From: billr@saab.CNA.TEK.COM (Bill Randle)
  3. Newsgroups: comp.sources.games
  4. Subject: v08i001:  conquer4 - middle earth multi-player game (V4), Patch4a
  5. Message-ID: <4411@tekred.CNA.TEK.COM>
  6. Date: 7 Aug 89 13:49:43 GMT
  7. Sender: news@tekred.CNA.TEK.COM
  8. Lines: 1609
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted-by: Adam Bryant <adb@cs.bu.edu>
  12. Posting-number: Volume 8, Issue 1
  13. Archive-name: conquer4/Patch4a
  14. Patch-To: conquer4: Volume 6, Issue 83-97
  15.  
  16. [[from the author...
  17.  
  18. This time it is only three shar files.  They unpack into two files:
  19.  
  20.     display.c    - replace the current display.c with this.
  21.     patchV4.04   - patch file for remainder of files.
  22.  
  23. Here are some notes about patch #4:
  24.  
  25.    -it fixes the following bugs:
  26.       = new nations being unable to fight monsters.
  27.       = a number of bugs dealing with the demi-god routines.
  28.       = an overflow bug due to mathematical ordering in newlogin.c.
  29.       = a miscalculation on npctype definition resulting in a core dump
  30.          in some instances.
  31.       = npc nations being able to move through neutral territory.
  32.       = npc nations being able to disband or group Zombies.
  33.       = armies disappearing off of ships.  [damn stupid oversite
  34.          on that one.]
  35.       = XENIX bugs fixed.
  36.       = password entry using gets() during curses mode.
  37.  
  38.     -it makes the following additions:
  39.       = full dual display mode via the 'd/' command.
  40.       = the man.pag was made up to date.
  41.       = makeworld is now done through curses.
  42.       = map print out routines enhanced and moved to 'conquer'.
  43.       = NOSCORE option to limit amount of information displayed on
  44.          score lists.
  45.       = REMAKE compiler option to allow rebuilds of worlds without
  46.          having to delete the data file.  This will also work for
  47.          demi-gods.
  48.       = MORE_MONST option now makes rebirth of monsters a compilation
  49.          selection.
  50.  
  51.     -THINGS TO COME NEXT PATCH:
  52.       = a set of conquer map manipulation programs:
  53.  
  54.        one for the sun to display the images to the screen.   [rjc]
  55.          [Would have released this a while ago, but I can't test
  56.          it yet, since I have not installed conquer on our suns]
  57.        one for PostScript to generate nice looking maps.      [MaF]
  58.          [Have seen the preliminary output of this and I am impressed,
  59.          hopefully it will be totally finished in a few days]
  60.  
  61.       = some bug fixes.  [can't be specific, since I haven't
  62.          heard the bug reports for this patch yet ;-)]
  63.  
  64. Once again you can find out a full list of what I was up to
  65. by looking at the patched notes.v4 file.
  66.  
  67. adam ]]
  68. =================================================================
  69.  
  70. And here is the first of three shar files:
  71.  
  72. =================================================================
  73.  
  74. #!/bin/sh
  75. # shar:    Shell Archiver  (v1.22)
  76. #
  77. # This is part 1 of a multipart archive                                    
  78. # do not concatenate these parts, unpack them in order with /bin/sh        
  79. #
  80. #    Run the following text with /bin/sh to create:
  81. #      patchV4.04
  82. #      display.c
  83. #
  84. if test -r s2_seq_.tmp
  85. then echo "Must unpack archives in sequence!"
  86.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  87.      exit 1; fi
  88. sed 's/^X//' << 'SHAR_EOF' > patchV4.04 &&
  89. X*** opatchlevel.h    Sun Aug  6 20:55:35 1989
  90. X--- patchlevel.h    Sun Aug  6 20:55:41 1989
  91. X***************
  92. X*** 1 ****
  93. X! #define PATCHLEVEL    3
  94. X--- 1 ----
  95. X! #define PATCHLEVEL    4
  96. X*** onotes.v4    Sun Aug  6 20:55:35 1989
  97. X--- notes.v4    Sun Aug  6 20:55:41 1989
  98. X***************
  99. X*** 102,114 ****
  100. X   66. rewrote all routines that were called during a newlogin so that print
  101. X      statments use the newerror() or newmsg() interface.
  102. X  ===4.0 patch number three released => 4.3 ==========================
  103. X  
  104. X  -------------------------------------------------------------------------
  105. X  | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4             |
  106. X  -------------------------------------------------------------------------
  107. X  o make land capture only occur during update.
  108. X! o make the create world routine interactive with curses display.
  109. X! o make the newlogin routine interactive with curses display.
  110. X  o fix the helpfiles to reflect current changes in game as noted later in this
  111. X      file.
  112. X  o there is some overflow somewhere, which creates a huge amount of gold
  113. X--- 102,169 ----
  114. X   66. rewrote all routines that were called during a newlogin so that print
  115. X      statments use the newerror() or newmsg() interface.
  116. X  ===4.0 patch number three released => 4.3 ==========================
  117. X+  67. fixed a bug reported long ago.. negative treasury and charity.
  118. X+     I get too damn much mail.  [I just sent #3 out!!!!]
  119. X+  68. main.c(798): "%s%s" to "%s%d"... fixes bug in sprintf.
  120. X+  69. added sprinf(defaultdir,"") to main.c and admin.c.
  121. X+  70. put test on error messages in place() to make sure it won't call newerror.
  122. X+  71. moved the '-p' option from admin.c to main.c.
  123. X+  72. made error messages in main.c go to stderr instead of stdout.
  124. X+  73. made the '-p' flag display world as seen by nations eyes.
  125. X+  74. made the designation portion of the display print elevation when NODESIG.
  126. X+  75. added fix to make sure that demi-god exists.  [Richard Caley]
  127. X+  76. added check to makeworld to make sure given demi-god name exists.
  128. X+  76. also added a check to forms.c for demi-god name change.
  129. X+  76. added checks for ORCTAKE definitions to newhelp.c [Jerome Marella]
  130. X+  77. added a CURRENT directory definition to Makefile. [Kevin Coombes]
  131. X+  78. fixed bugs in XENIX defines. [Jonathan Bayer]
  132. X+  79. display.c(301): "+" -> '+'; I thought I fixed this *sigh*. [Richard Caley]
  133. X+  80. added a REMAKE compiler option to allow destruction of currently running
  134. X+     games.  This is usable by demi-god to restart a campaign.
  135. X+  81. fixed up the man page.
  136. X+  82. wrote a non-echo string entry routine for curses password entry.
  137. X+  83. added above routine to newlogin.c, makeworl.c, and forms.c.
  138. X+  84. removed restriction on changing to NPC after making moves.
  139. X+     This makes sense... since players may move NPC pieces anyway.
  140. X+  85. changed the makeworld routine to curses interface.  This is still
  141. X+     rather rudimentary, and will be worked on prior to Version 5.0.
  142. X+  86. added NADJLOC; to the two split sections in reports.c:fleetrpt().
  143. X+  87. corrected misspelling of alignment throughout code.
  144. X+  88. added check to land_reachp() for neutral status.  [Michael D. Smith]
  145. X+  89. added MORE_MONST compiler option to decide whether or not empty
  146. X+     monster armies should be filled during the game.
  147. X+  90. fixed misspelling of 'defence' in npc.c and txt4.
  148. X+  91. fixed overflow of jewels and metal displaying in newlogin.c.
  149. X+  92. *&$%! fixed a stupid bug with checking if leader is really dead.
  150. X+  93. added a 'shipchk' to the prep routine.  hopefully will fix land taking.
  151. X+  94. added a redraw after movement if in army highlight mode.
  152. X+  95. added in new method for displaying anything in 2nd column. [Richard Caley]
  153. X+  96. tweeked the prompting for the second column display method.
  154. X+  97. rewrote the section in the help files on the display mode.
  155. X+  98. fixed major bug with destroying any army in water.  [Ben Herman]
  156. X+     Another bug I thought I fixed long ago. *sigh*
  157. X+  99. newlogin.c(1034):  typo caused nations to be too close. [Wes Shreiner]
  158. X+ 100. decrease range of nomad movement to 1 sector from locaton.
  159. X+ 101. removed the shipchk from prep()... didn't do jack anyway.
  160. X+ 102. hacked at the display code some to fix redeclarations and unused vars.
  161. X+ 103. fixed the bug with not being able to take sectors.  involved status
  162. X+     of nations not being at WAR with nomads.  fixed this by setting
  163. X+     statuses in three places:  destroy(), place(), check().
  164. X+ 104. fixed seg fault when entering change() for savages.
  165. X+ 105. removed the printing to fp in change() routine.
  166. X+ 106. changed npctype to detect monsters, otherwise it core dumps.
  167. X+ 107. changed the alignment printing for savages back to what it was.
  168. X+ 108. made sure that NPCs do not group or disband ZOMBIES.
  169. X+ 109. added a NOSCORE compiler option to allow only god to see full score list.
  170. X+ 110. changed the class name NPC to monster.
  171. X  
  172. X  -------------------------------------------------------------------------
  173. X  | 2.0 POSSIBLE SHORT-TERM ENHANCEMENTS/FIXES FOR CONQUER V4             |
  174. X  -------------------------------------------------------------------------
  175. X  o make land capture only occur during update.
  176. X! o some problems due to two nations capturing same land.  should fix by above.
  177. X! o some problems with MINER not providing initial stats on first turn after
  178. X!     nation has been added.
  179. X  o fix the helpfiles to reflect current changes in game as noted later in this
  180. X      file.
  181. X  o there is some overflow somewhere, which creates a huge amount of gold
  182. X*** oMakefile    Sun Aug  6 20:55:33 1989
  183. X--- Makefile    Sun Aug  6 20:55:41 1989
  184. X***************
  185. X*** 3,8 ****
  186. X--- 3,11 ----
  187. X  #    BY CHANGING THIS FILE, YOU AGREE TO ABIDE BY THE LIMITATIONS STATED IN
  188. X  #    THE LIMITED USE CONTRACT CONTAINED IN THE FILE "header.h"
  189. X  #
  190. X+ #    Make sure to set your desired configuration by
  191. X+ #    editing the file "header.h".
  192. X+ #
  193. X  #       This makefile has been modified to allow compilation using
  194. X  #       a parallelized make program.  It has been used successfully
  195. X  #       on an Encore Multimax parallel computer with both 4 and
  196. X***************
  197. X*** 13,18 ****
  198. X--- 16,23 ----
  199. X  #       Please report any problems to adb@bucsf.bu.edu
  200. X  #                   or adb@bu-cs.bu.edu
  201. X  #
  202. X+ #    Conquer news mailing list: conquer-news-request@bu-cs.bu.edu.
  203. X+ #
  204. X  MAKE    = /bin/make
  205. X  CC    = /bin/cc
  206. X  RM      = /bin/rm -f
  207. X***************
  208. X*** 44,53 ****
  209. X  #    of conquer.  [not distributed with conquer V4]
  210. X  #GETOPT    = getopt.o
  211. X  
  212. X! #if the final link does not compile change to the line below
  213. X  LIBRARIES = -lcurses -ltermcap
  214. X  #LIBRARIES = -lcurses
  215. X  
  216. X  #    DEFAULT is the directory where default nations & help files will be 
  217. X  #    stored.     It is also the default directory = where players will play 
  218. X  #    if they do not use the -d option.
  219. X--- 49,68 ----
  220. X  #    of conquer.  [not distributed with conquer V4]
  221. X  #GETOPT    = getopt.o
  222. X  
  223. X! #
  224. X! #    libraries for BSD systems:
  225. X  LIBRARIES = -lcurses -ltermcap
  226. X+ #
  227. X+ #    libraries for SYSV systems:
  228. X  #LIBRARIES = -lcurses
  229. X+ #
  230. X+ #    libraries for Xenix systems:
  231. X+ #LIBRARIES = -ltermlib -ltcap -lcrypt
  232. X  
  233. X+ #    CURRENT is this directory.  The directory where the source
  234. X+ #    and Makefile are located
  235. X+ CURRENT = /usr4/acm/stud/adb/src/conquer
  236. X+ 
  237. X  #    DEFAULT is the directory where default nations & help files will be 
  238. X  #    stored.     It is also the default directory = where players will play 
  239. X  #    if they do not use the -d option.
  240. X***************
  241. X*** 193,209 ****
  242. X  insthelp:    helpfile
  243. X      @echo Installing helpfiles
  244. X      -$(RM) $(DEFAULT)/$(HELPOUT)0
  245. X!     -$(LN) $(HELPOUT)0 $(DEFAULT)/$(HELPOUT)0
  246. X      -$(RM) $(DEFAULT)/$(HELPOUT)1
  247. X!     -$(LN) $(HELPOUT)1 $(DEFAULT)/$(HELPOUT)1
  248. X      -$(RM) $(DEFAULT)/$(HELPOUT)2
  249. X!     -$(LN) $(HELPOUT)2 $(DEFAULT)/$(HELPOUT)2
  250. X      -$(RM) $(DEFAULT)/$(HELPOUT)3
  251. X!     -$(LN) $(HELPOUT)3 $(DEFAULT)/$(HELPOUT)3
  252. X      -$(RM) $(DEFAULT)/$(HELPOUT)4
  253. X!     -$(LN) $(HELPOUT)4 $(DEFAULT)/$(HELPOUT)4
  254. X      -$(RM) $(DEFAULT)/$(HELPOUT)5
  255. X!     -$(LN) $(HELPOUT)5 $(DEFAULT)/$(HELPOUT)5
  256. X      touch insthelp
  257. X  
  258. X  helpfile:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  259. X--- 208,224 ----
  260. X  insthelp:    helpfile
  261. X      @echo Installing helpfiles
  262. X      -$(RM) $(DEFAULT)/$(HELPOUT)0
  263. X!     -$(LN) $(CURRENT)/$(HELPOUT)0 $(DEFAULT)/$(HELPOUT)0
  264. X      -$(RM) $(DEFAULT)/$(HELPOUT)1
  265. X!     -$(LN) $(CURRENT)/$(HELPOUT)1 $(DEFAULT)/$(HELPOUT)1
  266. X      -$(RM) $(DEFAULT)/$(HELPOUT)2
  267. X!     -$(LN) $(CURRENT)/$(HELPOUT)2 $(DEFAULT)/$(HELPOUT)2
  268. X      -$(RM) $(DEFAULT)/$(HELPOUT)3
  269. X!     -$(LN) $(CURRENT)/$(HELPOUT)3 $(DEFAULT)/$(HELPOUT)3
  270. X      -$(RM) $(DEFAULT)/$(HELPOUT)4
  271. X!     -$(LN) $(CURRENT)/$(HELPOUT)4 $(DEFAULT)/$(HELPOUT)4
  272. X      -$(RM) $(DEFAULT)/$(HELPOUT)5
  273. X!     -$(LN) $(CURRENT)/$(HELPOUT)5 $(DEFAULT)/$(HELPOUT)5
  274. X      touch insthelp
  275. X  
  276. X  helpfile:    $(HELPOUT)0 $(HELPOUT)1 $(HELPOUT)2 $(HELPOUT)3 $(HELPOUT)4 $(HELPOUT)5
  277. X*** oREADME    Sun Aug  6 20:55:33 1989
  278. X--- README    Sun Aug  6 20:55:41 1989
  279. X***************
  280. X*** 16,21 ****
  281. X--- 16,26 ----
  282. X  useful to me as they are my primary method of deciding what to next add to the
  283. X  code.  Your interest is appreciated.
  284. X  
  285. X+ A mailing list for conquer has been set up to provide a platform for conquer
  286. X+ discussion, and location for conquer test patch releases.  The mailing list is
  287. X+ "conquer-news@bu-cs.bu.edu" and addition to or deletions from the mailing
  288. X+ list may be sent to "conquer-news-request@bu-cs.bu.edu".
  289. X+ 
  290. X  Included in this file are the following:
  291. X      1) A Brief Description of Conquer
  292. X      2) Installation (unpacking) Instructions
  293. X*** oheader.h    Sun Aug  6 20:55:34 1989
  294. X--- header.h    Sun Aug  6 20:55:42 1989
  295. X***************
  296. X*** 68,80 ****
  297. X  #define METALPCT 33    /* percent of tradegoods that are metals    */
  298. X  #define JEWELPCT 33    /* percent of tradegoods that are luxury items    */
  299. X  #define HIDELOC        /* defined if news is not to report sectors    */
  300. X- 
  301. X  #define OGOD        /* defined if you wish to enhance god powers.   */
  302. X! 
  303. X! #define DERVDESG    /* allow DERVISH to redesignate in a DESERT/ICE    */
  304. X  #define MONSTER    45    /* defined if pirates/savages/nomads/lzard exist.
  305. X                 represents # of sectors of land that need to be
  306. X                 in world per pirate/savage/nomad nation    */
  307. X  #define NPC    45    /* defined if NPC nations should exist. The numeric
  308. X                 represents # of sectors of land that need to be
  309. X                 in world per non-player character nation    */
  310. X--- 68,83 ----
  311. X  #define METALPCT 33    /* percent of tradegoods that are metals    */
  312. X  #define JEWELPCT 33    /* percent of tradegoods that are luxury items    */
  313. X  #define HIDELOC        /* defined if news is not to report sectors    */
  314. X  #define OGOD        /* defined if you wish to enhance god powers.   */
  315. X! #define REMAKE        /* may make a world even if datafile exists.    */
  316. X!             /* this allows demi-gods the ability to remake  */
  317. X!             /* their world.                                 */
  318. X! /* #define NOSCORE    /* only show full scores to god while in game    */
  319. X! #define DERVDESG    /* allow DERVISH to redesignate in DESERT/ICE    */
  320. X  #define MONSTER    45    /* defined if pirates/savages/nomads/lzard exist.
  321. X                 represents # of sectors of land that need to be
  322. X                 in world per pirate/savage/nomad nation    */
  323. X+ #define MORE_MONST    /* defined if destroyed monsters are replaced    */
  324. X  #define NPC    45    /* defined if NPC nations should exist. The numeric
  325. X                 represents # of sectors of land that need to be
  326. X                 in world per non-player character nation    */
  327. X*** odata.h    Sun Aug  6 20:55:34 1989
  328. X--- data.h    Sun Aug  6 20:55:42 1989
  329. X***************
  330. X*** 158,164 ****
  331. X      short    turn;        /* game turn            */
  332. X      long    m_mil;        /* number of mercs available    */
  333. X      short    m_aplus;    /* mercenary attack bonus    */
  334. X!     short    m_dplus;    /* mercenary defence bonus    */
  335. X      long    w_jewels;    /* jewels in world        */
  336. X      long    w_gold;        /* gold talons in world        */
  337. X      long    w_food;        /* food in world        */
  338. X--- 158,164 ----
  339. X      short    turn;        /* game turn            */
  340. X      long    m_mil;        /* number of mercs available    */
  341. X      short    m_aplus;    /* mercenary attack bonus    */
  342. X!     short    m_dplus;    /* mercenary defense bonus    */
  343. X      long    w_jewels;    /* jewels in world        */
  344. X      long    w_gold;        /* gold talons in world        */
  345. X      long    w_food;        /* food in world        */
  346. X***************
  347. X*** 218,225 ****
  348. X  
  349. X  
  350. X  /* NATION STRATEGY: a nation's strategy is a part of the ntn[].active
  351. X!  * variable which tells if it is a PC or NPC, its allignment, and its
  352. X!  * constraints allignments can be good, neutral, or evil. 
  353. X   * NPC Nations can be Expansionsist (with 0,2,4,6 sectors to expand into)
  354. X   * or Isolationist.    */
  355. X  #define    INACTIVE    0
  356. X--- 218,225 ----
  357. X  
  358. X  
  359. X  /* NATION STRATEGY: a nation's strategy is a part of the ntn[].active
  360. X!  * variable which tells if it is a PC or NPC, its alignment, and its
  361. X!  * constraints alignments can be good, neutral, or evil. 
  362. X   * NPC Nations can be Expansionsist (with 0,2,4,6 sectors to expand into)
  363. X   * or Isolationist.    */
  364. X  #define    INACTIVE    0
  365. X***************
  366. X*** 246,252 ****
  367. X  #define NPC_SAVAGE    21
  368. X  
  369. X  #define    ispc(x)        (((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
  370. X! #define    npctype(x)    (ispc(x) ? (x) : (x)/4)
  371. X  #define    isgood(x)    (npctype(x) == 1)
  372. X  #define    isneutral(x)    (npctype(x) == 2)
  373. X  #define    isevil(x)    (npctype(x) == 3)
  374. X--- 246,252 ----
  375. X  #define NPC_SAVAGE    21
  376. X  
  377. X  #define    ispc(x)        (((x)==PC_GOOD)||((x)==PC_EVIL)||((x)==PC_NEUTRAL))
  378. X! #define    npctype(x)    (ispc(x) ? (x) : (ismonst(x)?0:(x)/4))
  379. X  #define    isgood(x)    (npctype(x) == 1)
  380. X  #define    isneutral(x)    (npctype(x) == 2)
  381. X  #define    isevil(x)    (npctype(x) == 3)
  382. X***************
  383. X*** 616,622 ****
  384. X  extern int    unitvalid(),access(),orctake(),fort_val();
  385. X  extern int    addgships(),addmships(),addwships(),fltships();
  386. X  extern int    fltghold(),fltwhold(),fltmhold(),flthold(),compass();
  387. X! extern int    get_country(),check_lock(),doclass();
  388. X  extern unsigned short    fltspeed();
  389. X  extern void    do_pirate(), do_nomad(), do_savage(), do_lizard();
  390. X  extern void    getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
  391. X--- 616,622 ----
  392. X  extern int    unitvalid(),access(),orctake(),fort_val();
  393. X  extern int    addgships(),addmships(),addwships(),fltships();
  394. X  extern int    fltghold(),fltwhold(),fltmhold(),flthold(),compass();
  395. X! extern int    get_country(),check_lock(),doclass(),get_pass();
  396. X  extern unsigned short    fltspeed();
  397. X  extern void    do_pirate(), do_nomad(), do_savage(), do_lizard();
  398. X  extern void    getjewel(),getmetal(),loadfleet(),removemgk(),exenewmgk();
  399. X***************
  400. X*** 629,635 ****
  401. X  extern void    errormsg(), clear_bottom(), addgroup(),ext_cmd();
  402. X  extern void    randomevent(), wdisaster(), weather(), deplete();
  403. X  extern void    verify_ntn(), verify_sct(), verifydata(), prep();
  404. X! extern void    newbye(), newreset(), newmsg(), newerror(), newinit();
  405. X  extern void    destroy(), updmove(), spreadsheet(), mailopen(), mailclose();
  406. X  extern void    updexecs(), updcapture(), updsectors();
  407. X  extern void    updmil(), updcomodities(), updleader();
  408. X--- 629,636 ----
  409. X  extern void    errormsg(), clear_bottom(), addgroup(),ext_cmd();
  410. X  extern void    randomevent(), wdisaster(), weather(), deplete();
  411. X  extern void    verify_ntn(), verify_sct(), verifydata(), prep();
  412. X! extern void    errorbar(), newbye(), newreset(), newmsg(), newerror();
  413. X! extern void    newinit();
  414. X  extern void    destroy(), updmove(), spreadsheet(), mailopen(), mailclose();
  415. X  extern void    updexecs(), updcapture(), updsectors();
  416. X  extern void    updmil(), updcomodities(), updleader();
  417. X***************
  418. X*** 881,887 ****
  419. X  extern    FILE    *fm;
  420. X  extern    int    mailok;
  421. X  extern    char    *seasonstr[];
  422. X! extern    char    *allignment[];    
  423. X  extern    struct    s_sector    **sct;
  424. X  extern    struct    s_nation    ntn[NTOTAL];
  425. X  extern    struct    s_nation    *curntn;    
  426. X--- 882,888 ----
  427. X  extern    FILE    *fm;
  428. X  extern    int    mailok;
  429. X  extern    char    *seasonstr[];
  430. X! extern    char    *alignment[];    
  431. X  extern    struct    s_sector    **sct;
  432. X  extern    struct    s_nation    ntn[NTOTAL];
  433. X  extern    struct    s_nation    *curntn;    
  434. X*** oadmin.c    Sun Aug  6 20:55:33 1989
  435. X--- admin.c    Sun Aug  6 20:55:42 1989
  436. X***************
  437. X*** 38,43 ****
  438. X--- 38,44 ----
  439. X  /* nation id of owner*/
  440. X  short    country=0;
  441. X  struct    s_nation    *curntn;
  442. X+ extern char datadir[];
  443. X  
  444. X  FILE *fexe, *fopen();
  445. X  
  446. X***************
  447. X*** 54,67 ****
  448. X      long time();
  449. X      /* mflag = makeworld, a=add player, x=execute, p=print */
  450. X      /* rflag = make world from read in files */
  451. X!     int mflag, aflag, xflag, pflag, rflag;
  452. X      char string[FILELTH];
  453. X      extern char *optarg;
  454. X      char defaultdir[BIGLTH],cq_opts[BIGLTH];
  455. X!     struct passwd *getpwnam();
  456. X  
  457. X!     mflag = aflag = xflag = pflag = rflag = 0;
  458. X      srand((unsigned) time((long *) 0));
  459. X      strcpy(cq_opts,"");
  460. X      name = string;
  461. X      *name = 0;
  462. X--- 55,69 ----
  463. X      long time();
  464. X      /* mflag = makeworld, a=add player, x=execute, p=print */
  465. X      /* rflag = make world from read in files */
  466. X!     int mflag, aflag, xflag, rflag;
  467. X      char string[FILELTH];
  468. X      extern char *optarg;
  469. X      char defaultdir[BIGLTH],cq_opts[BIGLTH];
  470. X!     struct passwd *getpwnam(), *pwent;
  471. X  
  472. X!     mflag = aflag = xflag = rflag = 0;
  473. X      srand((unsigned) time((long *) 0));
  474. X+     strcpy(datadir,"");
  475. X      strcpy(cq_opts,"");
  476. X      name = string;
  477. X      *name = 0;
  478. X***************
  479. X*** 102,110 ****
  480. X                  if (i<l) {
  481. X                      /* grab the data directory */
  482. X                      for (j=0; j<l-i && cq_opts[i+j]!=',';j++) {
  483. X!                         defaultdir[j] = cq_opts[i+j];
  484. X                      }
  485. X!                     defaultdir[j]='\0';
  486. X                      i += j-1;
  487. X                  }
  488. X                  break;
  489. X--- 104,112 ----
  490. X                  if (i<l) {
  491. X                      /* grab the data directory */
  492. X                      for (j=0; j<l-i && cq_opts[i+j]!=',';j++) {
  493. X!                         datadir[j] = cq_opts[i+j];
  494. X                      }
  495. X!                     datadir[j]='\0';
  496. X                      i += j-1;
  497. X                  }
  498. X                  break;
  499. X***************
  500. X*** 123,135 ****
  501. X           }
  502. X      }
  503. X  
  504. X-     /* set the default data directory */
  505. X-     if (defaultdir[0] == '\0') {
  506. X-         strcpy(defaultdir, DEFAULTDIR);
  507. X-     }
  508. X- 
  509. X      /* process the command line arguments */
  510. X!     while((i=getopt(argc,argv,"maxpr:d:"))!=EOF) switch(i){
  511. X      /* process the command line arguments */
  512. X      case 'm':  /* make a new world*/
  513. X          mflag++;
  514. X--- 125,132 ----
  515. X           }
  516. X      }
  517. X  
  518. X      /* process the command line arguments */
  519. X!     while((i=getopt(argc,argv,"maxr:d:"))!=EOF) switch(i){
  520. X      /* process the command line arguments */
  521. X      case 'm':  /* make a new world*/
  522. X          mflag++;
  523. X***************
  524. X*** 140,148 ****
  525. X      case 'x': /* execute program*/
  526. X          xflag++;
  527. X          break;
  528. X-     case 'p': /* print the map*/
  529. X-         pflag++;
  530. X-         break;
  531. X      case 'r': /* read map file */
  532. X          rflag++;
  533. X          if(strlen(optarg) > NAMELTH){
  534. X--- 137,142 ----
  535. X***************
  536. X*** 152,166 ****
  537. X          strcpy(scenario, optarg);
  538. X          break;
  539. X      case 'd':
  540. X!         strcpy(defaultdir, optarg);
  541. X          break;
  542. X      case '?': /*  print out command line arguments */
  543. X!         printf("Command line format: %s [-maxp -dDIR -rSCENARIO]\n",argv[0]);
  544. X          printf("\t-m          make a world\n");
  545. X          printf("\t-a          add new player\n");
  546. X          printf("\t-x          execute program\n");
  547. X          printf("\t-d DIR      to use play different game\n");
  548. X-         printf("\t-p          print a map\n");
  549. X          /* printf("\t-r SCENARIO read map while making a new world\n\t\t\tuses SCENARIO.ele, SCENARIO.veg, &  SCENARIO.nat\n"); */
  550. X          exit(SUCCESS);
  551. X      };
  552. X--- 146,159 ----
  553. X          strcpy(scenario, optarg);
  554. X          break;
  555. X      case 'd':
  556. X!         strcpy(datadir, optarg);
  557. X          break;
  558. X      case '?': /*  print out command line arguments */
  559. X!         printf("Command line format: %s [-max -dDIR -rSCENARIO]\n",argv[0]);
  560. X          printf("\t-m          make a world\n");
  561. X          printf("\t-a          add new player\n");
  562. X          printf("\t-x          execute program\n");
  563. X          printf("\t-d DIR      to use play different game\n");
  564. X          /* printf("\t-r SCENARIO read map while making a new world\n\t\t\tuses SCENARIO.ele, SCENARIO.veg, &  SCENARIO.nat\n"); */
  565. X          exit(SUCCESS);
  566. X      };
  567. X***************
  568. X*** 170,178 ****
  569. X      (void) setuid (geteuid ()) ;
  570. X  
  571. X      /* set proper defaultdir */
  572. X!     if (defaultdir[0] != '/') {
  573. X!         strcpy(cq_opts, defaultdir);
  574. X!         sprintf(defaultdir, "%s/%s", DEFAULTDIR, cq_opts);
  575. X      }
  576. X  
  577. X      /* now that we have parsed the args, we can got to the
  578. X--- 163,177 ----
  579. X      (void) setuid (geteuid ()) ;
  580. X  
  581. X      /* set proper defaultdir */
  582. X!     if (datadir[0] != '/') {
  583. X!         if (strlen(datadir) > 0) {
  584. X!             sprintf(defaultdir, "%s/%s", DEFAULTDIR, datadir);
  585. X!         } else {
  586. X!             strcpy(defaultdir,DEFAULTDIR);
  587. X!             strcpy(datadir,"[default]");
  588. X!         }
  589. X!     } else {
  590. X!         strcpy(defaultdir,datadir);
  591. X      }
  592. X  
  593. X      /* now that we have parsed the args, we can got to the
  594. X***************
  595. X*** 183,199 ****
  596. X          exit(FAIL);
  597. X      }
  598. X      if((mflag)||(rflag)) {
  599. X          if(realuser!=(getpwnam(LOGIN)->pw_uid)) {
  600. X              printf("Sorry -- you can not create a world\n");
  601. X!             printf("you need to be logged in as %s",LOGIN);
  602. X!             if (strcmp(LOGIN, ntn[0].leader)!=0) {
  603. X!                 printf(" or %s",ntn[0].leader);
  604. X!             }
  605. X!             printf("\n");
  606. X          }
  607. X          sprintf(string,"%sup",isonfile);
  608. X          unlink(string);
  609. X-         makeworld(rflag);
  610. X          exit(SUCCESS);
  611. X      }
  612. X  
  613. X--- 182,244 ----
  614. X          exit(FAIL);
  615. X      }
  616. X      if((mflag)||(rflag)) {
  617. X+ #ifdef REMAKE
  618. X+         /* check if datafile currently exists*/
  619. X+         if(access(datafile,00) == 0) {
  620. X+             /* read in the data*/
  621. X+             readdata();
  622. X+             verifydata( __FILE__, __LINE__ );
  623. X+ 
  624. X+             /* verify ability to remake the world */
  625. X+             if ((realuser != (getpwnam(LOGIN))->pw_uid ) &&
  626. X+                 ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  627. X+                 realuser != pwent->pw_uid )) {
  628. X+                 printf("Sorry -- you can not create a world\n");
  629. X+                 printf("you need to be logged in as %s",LOGIN);
  630. X+                 if (strcmp(LOGIN, ntn[0].leader)!=0) {
  631. X+                     printf(" or %s",ntn[0].leader);
  632. X+                 }
  633. X+                 printf(".\n");
  634. X+                 exit(FAIL);
  635. X+             }
  636. X+             printf("************* WARNING!!!! *******************\n\n");
  637. X+             printf("    There is already a game in progress.\n\n");
  638. X+             printf("*********************************************\n\n");
  639. X+             printf("Do you wish to destroy the current game? ");
  640. X+             scanf("%s",string);
  641. X+             if (strcmp(string,"yes")!=0 && strcmp(string,"y")!=0) {
  642. X+                 printf("Okay... the world is left intact\n");
  643. X+                 exit(FAIL);
  644. X+             }
  645. X+             printf("Are you absolutely certain? ");
  646. X+             scanf("%s",string);
  647. X+             if (strcmp(string,"yes")!=0 && strcmp(string,"y")!=0) {
  648. X+                 printf("Okay... the world is left intact\n");
  649. X+                 exit(FAIL);
  650. X+             }
  651. X+             printf("The re-destruction of the world has begun...\n");
  652. X+             sleep(1);
  653. X+         }
  654. X+ #else
  655. X+         /* check for god permissions */
  656. X          if(realuser!=(getpwnam(LOGIN)->pw_uid)) {
  657. X              printf("Sorry -- you can not create a world\n");
  658. X!             printf("you need to be logged in as %s.\n",LOGIN);
  659. X!             exit(FAIL);
  660. X          }
  661. X+ 
  662. X+         /* check if datafile already exists*/
  663. X+         if(access(datafile,00) == 0) {
  664. X+             printf("ABORTING: File %s exists\n",datafile);
  665. X+             printf("\tthis means that a game is in progress. To proceed, you must remove \n");
  666. X+             printf("\tthe existing data file. This will, of course, destroy that game.\n\n");
  667. X+             exit(FAIL);
  668. X+         }
  669. X+ #endif /* REMAKE */
  670. X+ 
  671. X+         makeworld(rflag);
  672. X          sprintf(string,"%sup",isonfile);
  673. X          unlink(string);
  674. X          exit(SUCCESS);
  675. X      }
  676. X  
  677. X***************
  678. X*** 245,252 ****
  679. X      }
  680. X  
  681. X  #ifdef OGOD
  682. X!     if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
  683. X!        (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
  684. X          printf("Sorry -- you can not administrate conquer\n");
  685. X          printf("you need to be logged in as %s",LOGIN);
  686. X          if (strcmp(LOGIN, ntn[0].leader)!=0) {
  687. X--- 290,298 ----
  688. X      }
  689. X  
  690. X  #ifdef OGOD
  691. X!     if ((realuser != (getpwnam(LOGIN))->pw_uid ) &&
  692. X!       ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  693. X!       realuser != pwent->pw_uid )) {
  694. X          printf("Sorry -- you can not administrate conquer\n");
  695. X          printf("you need to be logged in as %s",LOGIN);
  696. X          if (strcmp(LOGIN, ntn[0].leader)!=0) {
  697. X***************
  698. X*** 257,285 ****
  699. X      }
  700. X  #endif OGOD
  701. X  
  702. X!     if (pflag) {    /* print a map of the game */
  703. X!         fprintf(stderr,"\nFor convenience, this output is to stderr,\n");
  704. X!         fprintf(stderr,"while the maps will be sent to stdout.\n\n");
  705. X!         fprintf(stderr,"\tThe valid options are,\n");
  706. X!         fprintf(stderr,"\t\t1) altitudes\n\t\t2) vegetations\n");
  707. X!         fprintf(stderr,"\t\t3) nations\n");
  708. X!         fprintf(stderr,"\t\t4) designations\n\n");
  709. X!         fprintf(stderr,"\tWhat type of map? ");
  710. X!         scanf("%hd", &dismode);
  711. X!         fprintf(stderr,"\n");
  712. X!         if(dismode==1) printele();
  713. X!         else if(dismode==2) printveg();
  714. X!         else if(dismode==3) pr_ntns();
  715. X!         else if(dismode==4) pr_desg();
  716. X!         else {
  717. X!              fprintf(stderr,"must be 1-4\n");
  718. X!              exit(FAIL);
  719. X!         }
  720. X!         exit(SUCCESS);
  721. X!     } else if (xflag) {    /* update the game */
  722. X  #ifndef OGOD
  723. X!         if((realuser!=(getpwnam(LOGIN)->pw_uid))&&
  724. X!            (realuser!=(getpwnam(ntn[0].leader)->pw_uid))) {
  725. X              printf("sorry -- your uid is invalid for updating\n");
  726. X              printf("you need to be logged in as %s",LOGIN);
  727. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  728. X--- 303,313 ----
  729. X      }
  730. X  #endif OGOD
  731. X  
  732. X!     if (xflag) {    /* update the game */
  733. X  #ifndef OGOD
  734. X!         if ((realuser != (getpwnam(LOGIN))->pw_uid ) &&
  735. X!           ((pwent=getpwnam(ntn[0].leader)) == NULL ||
  736. X!           realuser != pwent->pw_uid )) {
  737. X              printf("sorry -- your uid is invalid for updating\n");
  738. X              printf("you need to be logged in as %s",LOGIN);
  739. X              if (strcmp(LOGIN, ntn[0].leader)!=0) {
  740. X***************
  741. X*** 318,328 ****
  742. X      printf("error: must specify an option\n");
  743. X  
  744. X      /*  print out command line arguments */
  745. X!     printf("Command line format: %s [-maxp -dDIR]\n",argv[0]);
  746. X      printf("\t-a       add new player\n");
  747. X      printf("\t-d DIR   to use play different game\n");
  748. X      printf("\t-m       make a world\n");
  749. X-     printf("\t-p       print a map\n");
  750. X      printf("\t-x       execute program\n");
  751. X      exit(SUCCESS);
  752. X  }
  753. X--- 346,355 ----
  754. X      printf("error: must specify an option\n");
  755. X  
  756. X      /*  print out command line arguments */
  757. X!     printf("Command line format: %s [-max -dDIR]\n",argv[0]);
  758. X      printf("\t-a       add new player\n");
  759. X      printf("\t-d DIR   to use play different game\n");
  760. X      printf("\t-m       make a world\n");
  761. X      printf("\t-x       execute program\n");
  762. X      exit(SUCCESS);
  763. X  }
  764. X***************
  765. X*** 378,385 ****
  766. X          WORLDMIL+=curntn->tmil;
  767. X      }
  768. X      if (WORLDGOLD==0) WORLDGOLD=1;
  769. X!     printf("calculating new national attributes:  sum of scores=%ld of mil=%ld\n",WORLDSCORE,WORLDMIL);
  770. X! 
  771. X      /* count the number of sectors */
  772. X      for(country=1;country<NTOTAL;country++) {
  773. X          if(!isntn(ntn[country].active)) continue;
  774. X--- 405,411 ----
  775. X          WORLDMIL+=curntn->tmil;
  776. X      }
  777. X      if (WORLDGOLD==0) WORLDGOLD=1;
  778. X!     
  779. X      /* count the number of sectors */
  780. X      for(country=1;country<NTOTAL;country++) {
  781. X          if(!isntn(ntn[country].active)) continue;
  782. X*** omakeworl.c    Sun Aug  6 20:55:34 1989
  783. X--- makeworl.c    Sun Aug  6 20:55:42 1989
  784. X***************
  785. X*** 15,20 ****
  786. X--- 15,21 ----
  787. X  /*DEFINE TEMPORARY VARIABLES FROM MAKEFILE*/
  788. X  #include <ctype.h>
  789. X  #include <stdio.h>
  790. X+ #include <pwd.h>
  791. X  #include "header.h"
  792. X  #include "data.h"
  793. X  
  794. X***************
  795. X*** 24,29 ****
  796. X--- 25,31 ----
  797. X  int pwater;        /* percent water in world (0-100) */
  798. X  extern short    country;
  799. X  extern int    numleaders;
  800. X+ char datadir[FILELTH];
  801. X  char **area_map;            /*Value Map of Areas*/
  802. X  char **type;
  803. X  
  804. X***************
  805. X*** 41,146 ****
  806. X  }
  807. X  
  808. X  void
  809. X  makeworld(rflag)
  810. X  int    rflag;        /* TRUE if you wish to read in a map from mapfiles */
  811. X  {
  812. X      char passwd[PASSLTH+1],*getpass();
  813. X!     char newstring[BIGLTH];
  814. X      FILE *fopen();
  815. X  
  816. X!     /*abort if datafile currently exists*/
  817. X!     if(access(datafile,00) == 0) {
  818. X!         printf("ABORTING: File %s exists\n",datafile);
  819. X!         printf("\tthis means that a game is in progress. To proceed, you must remove \n");
  820. X!         printf("\tthe existing data file. This will, of course, destroy that game.\n\n");
  821. X!         exit(FAIL);
  822. X!     }
  823. X! printf("\n************************** WELCOME TO CONQUER **************************");
  824. X! printf("\n*\tThe world will now be created...                               *");
  825. X! printf("\n*\t                                                               *");
  826. X! printf("\n*\tYour super user login will be 'god'.                           *");
  827. X! printf("\n*\t                                                               *");
  828. X! printf("\n*\tNon player countries will be read from the file 'nations'      *");
  829. X! printf("\n*\tand will have the same password as god (which you are about to *");
  830. X! printf("\n*\tenter). Add player nations with <conqrun -a>.  Have fun!!!     *");
  831. X! printf("\n*\t                                                               *");
  832. X! printf("\n*\tRemember to check the world out before playing to make sure    *");
  833. X! printf("\n*\tno nations are in bad positions (surrounded by water... )      *");
  834. X! printf("\n************************************************************************\n\n");
  835. X  
  836. X!     printf("First, we must zero extraneous files from prior games\n");
  837. X!     printf("\tignore any errors this causes\n");
  838. X      sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null",
  839. X          exefile, msgfile, newsfile, isonfile, tradefile, timefile);
  840. X-     printf("\t%s\n",newstring);
  841. X      system(newstring);
  842. X!     printf("OK This has been done, Now to set up a new world\n\n");
  843. X  
  844. X!     while(TRUE) {            /* password routine */
  845. X!         strncpy(passwd,getpass("please enter new conquer super user password (remember this!):"),PASSLTH);
  846. X!         strncpy(ntn[0].passwd,getpass("please reenter conquer password:"),PASSLTH);
  847. X!         if((strlen(passwd)<2)
  848. X!         ||(strncmp(ntn[0].passwd,passwd,PASSLTH)!=0)){
  849. X!             beep();
  850. X!             printf("\ninvalid super user password\n");
  851. X!         } else break;
  852. X!       }
  853. X  
  854. X      strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH);
  855. X! 
  856. X      /* finally ask for the secondary administrator */
  857. X!     printf("\nYou may now designate an alternate ruler for this world.");
  858. X      while(TRUE) {
  859. X!         printf("\nWhat demi-god shall rule this world? ");
  860. X!         gets( newstring );
  861. X          if (strlen(newstring)==0) {
  862. X!             printf("\nGod blesses this world with his presense!\n");
  863. X              (void) strcpy(ntn[0].leader,LOGIN);
  864. X              break;
  865. X          } else if (strlen(newstring) <= LEADERLTH) {
  866. X!             /* HOW DO YOU VERIFY THAT IT IS AN ACTUAL USER? */
  867. X!             printf("\nThe demi-god %s may administrate this new world.\n",newstring);
  868. X!             (void) strncpy(ntn[0].leader,newstring,LEADERLTH);
  869. X!             break;
  870. X          }
  871. X-         printf("\nName too long.");
  872. X      }
  873. X! 
  874. X      while(TRUE) {
  875. X!         printf("\nplease enter the size of the world\n");
  876. X! 
  877. X!         printf("values should be divisible by 8 & greater than 23\n");
  878. X!         printf("Enter number of X sectors: ");
  879. X!         gets( passwd );
  880. X!         world.mapx = atoi( passwd );
  881. X          if(((world.mapx % 8) != 0 ) || (world.mapx<24)){
  882. X!             printf("ERROR: Invalid value entered\n");
  883. X              continue;
  884. X          }
  885. X!         printf("Enter number of Y sectors: ");
  886. X!         gets( passwd );
  887. X!         world.mapy = atoi( passwd );
  888. X          if(((world.mapy % 8) != 0 ) || (world.mapy<24)){
  889. X!             printf("ERROR: Invalid value entered\n");
  890. X              continue;
  891. X          }
  892. X          break;
  893. X      }
  894. X  
  895. X      getspace();    /* malloc space for this world */
  896. X  
  897. X      /* get amount of water to have in the world */
  898. X      while(TRUE) {
  899. X!         printf("\nEnter percent water to have in world (0-100): ");
  900. X!         gets( passwd );
  901. X!         pwater = (-1);
  902. X!         pwater = atoi( passwd );
  903. X          if((pwater<0) || (pwater>100 )){
  904. X!             printf("ERROR: Invalid value entered\n");
  905. X              continue;
  906. X          }
  907. X          break;
  908. X      }
  909. X  
  910. X      if( rflag==FALSE ) createworld();
  911. X      else readmap();    /* read map in from mapfiles */
  912. X--- 43,209 ----
  913. X  }
  914. X  
  915. X  void
  916. X+ zeroworld()
  917. X+ {
  918. X+     int i,armynum,nvynum;
  919. X+ 
  920. X+     /* initialize all countries */
  921. X+     for (i = 0; i < NTOTAL; i++) {
  922. X+         curntn = &ntn[i];
  923. X+         for (armynum=0; armynum < MAXARM; armynum++) {
  924. X+             P_ASOLD = (long)0;
  925. X+             P_AXLOC = P_AYLOC = P_ATYPE = P_AMOVE = (unsigned char)0;
  926. X+             P_ASTAT = DEFEND;
  927. X+         }
  928. X+         for (nvynum=0; nvynum < MAXNAVY; nvynum++) {
  929. X+             P_NWSHP = P_NMSHP = P_NGSHP = (unsigned short)0;
  930. X+             P_NCREW = P_NPEOP = P_NARMY = (unsigned char)0;
  931. X+             P_NXLOC = P_NYLOC = P_NMOVE = (unsigned char)0;
  932. X+         }
  933. X+         curntn->active = INACTIVE;
  934. X+         curntn->repro = (char)0;
  935. X+         curntn->jewels = curntn->tgold = curntn->metals = 0L;
  936. X+         curntn->powers = curntn->tciv = curntn->tmil = curntn->score = 0L;
  937. X+         curntn->race = TUNKNOWN;
  938. X+         curntn->maxmove = 0;
  939. X+         curntn->class = curntn->aplus = curntn->dplus = (short)0;
  940. X+         curntn->inflation = curntn->tsctrs = curntn->tships = (short)0;
  941. X+     }
  942. X+ }
  943. X+ 
  944. X+ void
  945. X  makeworld(rflag)
  946. X  int    rflag;        /* TRUE if you wish to read in a map from mapfiles */
  947. X  {
  948. X      char passwd[PASSLTH+1],*getpass();
  949. X!     char newstring[BIGLTH],tempc[BIGLTH];
  950. X      FILE *fopen();
  951. X+     struct passwd *getpwnam();
  952. X+     int i,valid;
  953. X  
  954. X!     /* conquer makeworld information */
  955. X!     newinit();
  956. X!     sprintf(newstring, "Datadir: %s", datadir);
  957. X!     errorbar("World Generator", newstring);
  958. X  
  959. X!     mvaddstr(0,COLS/2-9,"WELCOME TO CONQUER");
  960. X!     mvaddstr(2,5,"Genesis begins...  Your super user login will be 'god'.");
  961. X!     mvaddstr(3,0,"Non-player countries will be read in from the file 'nations',");
  962. X!     mvaddstr(4,0,"and will have the same password as god, which you will soon set.");
  963. X!     mvaddstr(5,0,"     To add players after building:  conqrun -a");
  964. X!     if (strcmp(datadir,"[default]")!=0)
  965. X!         printw(" -d %s", datadir);
  966. X!     addch('.');
  967. X! 
  968. X!     newmsg("..Zero out extraneous files from prior games");
  969. X!     /* flush out beginning input */
  970. X!     while(getch()!='\n') ;
  971. X      sprintf(newstring,"rm -f %s* %s* %s* %s* %s %s 2> /dev/null",
  972. X          exefile, msgfile, newsfile, isonfile, tradefile, timefile);
  973. X      system(newstring);
  974. X!     newerror("....Initialize the nation structures");
  975. X!     zeroworld();
  976. X!     newerror("Initialization complete:  And there was light....");
  977. X  
  978. X!     valid=FALSE;
  979. X!     while(valid==FALSE) {            /* password routine */
  980. X!         mvprintw(7,0,"Enter Super-User Password: ");
  981. X!         clrtoeol();
  982. X!         refresh();
  983. X!         i = get_pass(newstring);
  984. X!         if (i < 4) {
  985. X!             newerror("Password Too Short");
  986. X!             continue;
  987. X!         } else if (i > PASSLTH) {
  988. X!             newerror("Password Too Long");
  989. X!             continue;
  990. X!         }
  991. X!         mvprintw(7,0,"Reenter Super-User Password: ");
  992. X!         clrtoeol();
  993. X!         refresh();
  994. X!         i = get_pass(passwd);
  995. X  
  996. X+         if((i<4)||(i>PASSLTH)||(strncmp(passwd,newstring,PASSLTH)!=0)){
  997. X+             newerror("Invalid Password Match");
  998. X+         } else valid=TRUE;
  999. X+     }
  1000. X      strncpy(ntn[0].passwd,crypt(passwd,SALT),PASSLTH);
  1001. X!     
  1002. X      /* finally ask for the secondary administrator */
  1003. X!     mvaddstr(7,0,"You may now designate an alternate ruler for this world.");
  1004. X      while(TRUE) {
  1005. X!         mvaddstr(8,0,"What demi-god shall rule this world? ");
  1006. X!         clrtoeol();
  1007. X!         refresh();
  1008. X!         get_nname( newstring );
  1009. X          if (strlen(newstring)==0) {
  1010. X!             newerror("God blesses this world with his presense!");
  1011. X              (void) strcpy(ntn[0].leader,LOGIN);
  1012. X+             mvaddstr(7,0,"Demi-God: [none]");
  1013. X+             clrtoeol();
  1014. X              break;
  1015. X          } else if (strlen(newstring) <= LEADERLTH) {
  1016. X!             if (getpwnam(newstring)!=NULL) {
  1017. X!                 sprintf(tempc,"The demi-god %s may administrate this new world.",newstring);
  1018. X!                 newerror(tempc);
  1019. X!                 (void) strncpy(ntn[0].leader,newstring,LEADERLTH);
  1020. X!                 mvprintw(7,0,"Demi-God: %s",ntn[0].leader);
  1021. X!                 clrtoeol();
  1022. X!                 break;
  1023. X!             } else {
  1024. X!                 sprintf(tempc,"Their is no mortal named %s on this system.",newstring);
  1025. X!                 newerror(tempc);
  1026. X!             }
  1027. X!         } else {
  1028. X!             newerror("That Name is Too long.");
  1029. X          }
  1030. X      }
  1031. X!     mvaddstr(8,0,"Please Enter the Size of the World.  [Divisible by 8 and > 23]");
  1032. X!     clrtoeol();
  1033. X      while(TRUE) {
  1034. X!         mvaddstr(9,0,"Enter number of X sectors: ");
  1035. X!         clrtoeol();
  1036. X!         refresh();
  1037. X!         world.mapx = get_number();
  1038. X          if(((world.mapx % 8) != 0 ) || (world.mapx<24)){
  1039. X!             newerror("Invalid X Value Entered");
  1040. X              continue;
  1041. X          }
  1042. X!         break;
  1043. X!     }
  1044. X!     while (TRUE) {
  1045. X!         mvaddstr(10,0,"Enter number of Y sectors: ");
  1046. X!         clrtoeol();
  1047. X!         refresh();
  1048. X!         world.mapy = get_number();
  1049. X          if(((world.mapy % 8) != 0 ) || (world.mapy<24)){
  1050. X!             newerror("Invalid Y Value Entered");
  1051. X              continue;
  1052. X          }
  1053. X          break;
  1054. X      }
  1055. X+     mvprintw(8,0,"Map Size: %dx%d", (int)world.mapx, (int)world.mapy);
  1056. X+     clrtoeol();
  1057. X+     move(10,0);
  1058. X+     clrtoeol();
  1059. X  
  1060. X      getspace();    /* malloc space for this world */
  1061. X  
  1062. X      /* get amount of water to have in the world */
  1063. X      while(TRUE) {
  1064. X!         mvaddstr(9,0,"Enter percent water to have in world (0-100): ");
  1065. X!         clrtoeol();
  1066. X!         refresh();
  1067. X!         pwater = get_number();
  1068. X          if((pwater<0) || (pwater>100 )){
  1069. X!             newerror("Invalid Percentage Entered");
  1070. X              continue;
  1071. X          }
  1072. X          break;
  1073. X      }
  1074. X+     mvprintw(9,0,"Percentage Water: %d", pwater);
  1075. X+     clrtoeol();
  1076. X+     refresh();
  1077. X  
  1078. X      if( rflag==FALSE ) createworld();
  1079. X      else readmap();    /* read map in from mapfiles */
  1080. X***************
  1081. X*** 156,163 ****
  1082. X          fprintf(fm,"5\tGLOBAL ANNOUNCEMENTS\n");
  1083. X          fclose(fm);
  1084. X      } else {
  1085. X!         fprintf(stderr,"error opening news file <%s>\n",newstring);
  1086. X      }
  1087. X  }
  1088. X  
  1089. X  void
  1090. X--- 219,228 ----
  1091. X          fprintf(fm,"5\tGLOBAL ANNOUNCEMENTS\n");
  1092. X          fclose(fm);
  1093. X      } else {
  1094. X!         sprintf(tempc,"error opening news file <%s>\n",newstring);
  1095. X!         newerror(tempc);
  1096. X      }
  1097. X+     newreset();
  1098. X  }
  1099. X  
  1100. X  void
  1101. X***************
  1102. X*** 181,192 ****
  1103. X      area_map = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  1104. X      type = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  1105. X  
  1106. X!     printf("\n\ncreating world\n");
  1107. X!     printf("\tin the beginning, the world was a set of bits ordered in\n");
  1108. X!     printf("\ta random way.  Then the conquer game administrator (hereafter\n");
  1109. X!     printf("\tknown as god) decreed 'conqrun -m'!!!\n");
  1110. X!     printf("\nday 1... and the variables were initialized\n\n");
  1111. X      /*initialize variables */
  1112. X      avvalue = (((float) (100-pwater)/25.0)); /*Average water tvalue of sectors*/
  1113. X      for(i=0;i<MAXX;i++) for(j=0;j<MAXY;j++)
  1114. X          tplace[i][j] = area_map[i][j] = 0;
  1115. X--- 246,266 ----
  1116. X      area_map = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  1117. X      type = (char **) m2alloc(MAPX,MAPY,sizeof(char));
  1118. X  
  1119. X!     mvaddstr(11,0,"Creating world");
  1120. X!     mvaddstr(12,5,"In the beginning, the world was a set of bits ordered in");
  1121. X!     mvaddstr(13,0,"a random way.  Then the conquer game administrator (hereafter");
  1122. X!     mvaddstr(14,0,"known as god) decreed 'conqrun -m'!!!");
  1123. X! 
  1124. X      /*initialize variables */
  1125. X+     newerror("Day 1... And the variables were initialized.");
  1126. X+     move(11,0);
  1127. X+     clrtoeol();
  1128. X+     move(12,0);
  1129. X+     clrtoeol();
  1130. X+     move(13,0);
  1131. X+     clrtoeol();
  1132. X+     move(14,0);
  1133. X+     clrtoeol();
  1134. X      avvalue = (((float) (100-pwater)/25.0)); /*Average water tvalue of sectors*/
  1135. X      for(i=0;i<MAXX;i++) for(j=0;j<MAXY;j++)
  1136. X          tplace[i][j] = area_map[i][j] = 0;
  1137. X***************
  1138. X*** 332,338 ****
  1139. X                  else type[X*8+i][Y*8+j]=HALF;
  1140. X                  break;
  1141. X              default:
  1142. X!                 fprintf(stderr,"ERROR\n");
  1143. X                  abrt();
  1144. X              }
  1145. X          }
  1146. X--- 406,413 ----
  1147. X                  else type[X*8+i][Y*8+j]=HALF;
  1148. X                  break;
  1149. X              default:
  1150. X!                 newerror("Uh oh!!!  The world has gone wacky.");
  1151. X!                 newreset();
  1152. X                  abrt();
  1153. X              }
  1154. X          }
  1155. X***************
  1156. X*** 350,357 ****
  1157. X      chance=0;
  1158. X      for(X=0;X<MAPX;X++) for(Y=0;Y<MAPY;Y++)
  1159. X          if(type[X][Y] == WATER) chance++;
  1160. X-     printf("day 2... and god decreed that water should have %d / %d sectors\n",chance,NUMSECTS);
  1161. X  
  1162. X      /*Newly added code to smooth the world out*/
  1163. X      for(X=1;X<MAPX-1;X++) for(Y=1;Y<MAPY-1;Y++) {
  1164. X          chance = 0;
  1165. X--- 425,435 ----
  1166. X      chance=0;
  1167. X      for(X=0;X<MAPX;X++) for(Y=0;Y<MAPY;Y++)
  1168. X          if(type[X][Y] == WATER) chance++;
  1169. X  
  1170. X+     mvprintw(10,0,"Water: %d / %d sectors",chance,NUMSECTS);
  1171. X+     clrtoeol();
  1172. X+     newerror("Day 2... God added water to the world");
  1173. X+ 
  1174. X      /*Newly added code to smooth the world out*/
  1175. X      for(X=1;X<MAPX-1;X++) for(Y=1;Y<MAPY-1;Y++) {
  1176. X          chance = 0;
  1177. X***************
  1178. X*** 364,371 ****
  1179. X      chance=0;
  1180. X      for(X=0;X<MAPX;X++) for(Y=0;Y<MAPY;Y++)
  1181. X          if(type[X][Y] == WATER) chance++;
  1182. X-     printf("\tbut god was not pleased and smoothed the oceans to %d / %d sectors\n\n",chance,NUMSECTS);
  1183. X  
  1184. X      /*Adjust world given sectors as land or sea, place vegetation,
  1185. X      designation, and altitude */
  1186. X  
  1187. X--- 442,452 ----
  1188. X      chance=0;
  1189. X      for(X=0;X<MAPX;X++) for(Y=0;Y<MAPY;Y++)
  1190. X          if(type[X][Y] == WATER) chance++;
  1191. X  
  1192. X+     mvprintw(10,0,"Water: %d / %d sectors",chance,NUMSECTS);
  1193. X+     clrtoeol();
  1194. X+     newerror("But God was not pleased... and smoothed the oceans.");
  1195. X+ 
  1196. X      /*Adjust world given sectors as land or sea, place vegetation,
  1197. X      designation, and altitude */
  1198. X  
  1199. X***************
  1200. X*** 377,383 ****
  1201. X      avvalue    = PMOUNT * (100-pwater);
  1202. X      avvalue    /= 10000;
  1203. X      nmountains    = NUMSECTS * avvalue;
  1204. X!     printf("day 3... god created %ld mountains and hills\n",nmountains);
  1205. X  
  1206. X      /* heuristic says that 5 is cutoff number to stop placing ranges */
  1207. X      /* and 1 third of mountains are placed as random hills        */
  1208. X--- 458,466 ----
  1209. X      avvalue    = PMOUNT * (100-pwater);
  1210. X      avvalue    /= 10000;
  1211. X      nmountains    = NUMSECTS * avvalue;
  1212. X!     
  1213. X!     mvprintw(11,0,"Hills and Mountains: %d",nmountains);
  1214. X!     newerror("Day 3... God created hills and mountains");
  1215. X  
  1216. X      /* heuristic says that 5 is cutoff number to stop placing ranges */
  1217. X      /* and 1 third of mountains are placed as random hills        */
  1218. X***************
  1219. X*** 568,573 ****
  1220. X--- 651,657 ----
  1221. X      int valid;
  1222. X      int nmountains;
  1223. X      struct    s_sector    *sptr;
  1224. X+     char newstring[BIGLTH];
  1225. X  
  1226. X      TURN=1;
  1227. X  
  1228. X***************
  1229. X*** 574,580 ****
  1230. X      nmountains = 10 * (END_NORMAL+1);
  1231. X      for(i=0;i<=END_NORMAL;i++) nmountains -= ( *(tg_value+i) - '0');
  1232. X  
  1233. X!     printf("\nday 4... and god placed the worlds raw materials\n");
  1234. X      for(y=0;y<MAPY;y++) for(x=0;x<MAPX;x++) {
  1235. X  
  1236. X          sptr = &sct[x][y];
  1237. X--- 658,664 ----
  1238. X      nmountains = 10 * (END_NORMAL+1);
  1239. X      for(i=0;i<=END_NORMAL;i++) nmountains -= ( *(tg_value+i) - '0');
  1240. X  
  1241. X!     newerror("Day 4... God placed the world's raw materials");
  1242. X      for(y=0;y<MAPY;y++) for(x=0;x<MAPX;x++) {
  1243. X  
  1244. X          sptr = &sct[x][y];
  1245. X***************
  1246. X*** 628,651 ****
  1247. X                  sptr->tradegood = i;
  1248. X              }
  1249. X              if(sptr->tradegood == TG_none)
  1250. X!                 printf("??? DEBUG -tradegood==NONE\n");
  1251. X          }
  1252. X      }
  1253. X  
  1254. X!     printf("\nday 5... and god decreed that world would be populated\n");
  1255. X!     printf("\tby all manner of creatures; big ones; little one; fat ones;\n");
  1256. X!     printf("\tskinny ones; orange ones; turquois ones; bright blue ones\n");
  1257. X!     printf("\tWAIT!!! god has suddenly realized that smurfs were taking things\n");
  1258. X!     printf("\ttoo far and stopped creating new ones to place everybody on the map...\n");
  1259. X      populate();
  1260. X      MERCMEN = ST_MMEN;
  1261. X      MERCATT = ST_MATT;
  1262. X      MERCDEF = ST_MDEF;
  1263. X!     printf("\nday 6... and god, who believed in a two day weekend, took off to\n\tthe local pub to celebrate...\n\n");
  1264. X!     printf("day 7... and god rested (to get rid of that stupid hangover)\n");
  1265. X!     printf("\tand thought about logging in to see what the world looks like\n");
  1266. X!     printf("\tand about telling players to add themselves to the game\n");
  1267. X!     printf("\twith the 'conqrun -a' command.\n");
  1268. X  }
  1269. X  
  1270. X  /*fill: subroutine to fill in a square edges with land or sea*/
  1271. X--- 712,752 ----
  1272. X                  sptr->tradegood = i;
  1273. X              }
  1274. X              if(sptr->tradegood == TG_none)
  1275. X!                 newerror("??? DEBUG -tradegood==NONE");
  1276. X          }
  1277. X      }
  1278. X  
  1279. X!     mvprintw(13,5,"All manner of creatures were created: big ones, little ones,");
  1280. X!     mvprintw(14,0,"fat ones, skinny ones, orange ones, turquois ones, bright blue ones.");
  1281. X!     mvprintw(15,0,"WAIT!!!  God has suddenly realized that smurfs were taking things");
  1282. X!     mvprintw(16,0,"too far and stopped creating new ones, and placed everybody on the map...");
  1283. X!     newerror("Day 5... God decreed that world would be populated");
  1284. X!     move(14,0);
  1285. X!     clrtoeol();
  1286. X!     move(15,0);
  1287. X!     clrtoeol();
  1288. X!     move(16,0);
  1289. X!     clrtoeol();
  1290. X      populate();
  1291. X      MERCMEN = ST_MMEN;
  1292. X      MERCATT = ST_MATT;
  1293. X      MERCDEF = ST_MDEF;
  1294. X!     newerror("Day 6... God, believing in long weekends, went and got smashed");
  1295. X!     newerror("Day 7... God rested (to get rid of that stupid hangover)");
  1296. X!     sprintf(newstring," ...Log in via 'conquer -n god");
  1297. X!     if (strcmp(datadir,"[default]")!=0) {
  1298. X!         strcat(newstring," -d ");
  1299. X!         strcat(newstring,datadir);
  1300. X!     }
  1301. X!     strcat(newstring,"'");
  1302. X!     newerror(newstring);
  1303. X!     sprintf(newstring," ...Players may be added via 'conqrun -a");
  1304. X!     if (strcmp(datadir,"[default]")!=0) {
  1305. X!         strcat(newstring," -d ");
  1306. X!         strcat(newstring,datadir);
  1307. X!     }
  1308. X!     strcat(newstring,"'");
  1309. X!     newerror(newstring);
  1310. X  }
  1311. X  
  1312. X  /*fill: subroutine to fill in a square edges with land or sea*/
  1313. X***************
  1314. X*** 722,728 ****
  1315. X  void
  1316. X  populate()
  1317. X  {
  1318. X!     int    i=0,x=0,y=0,j=0,xloc,yloc;
  1319. X      int    nvynum=0,armynum=0,points,shipsize,temp,cnum;
  1320. X      short    short1,short2;            /*temporary short variables */
  1321. X      short    class;
  1322. X--- 823,829 ----
  1323. X  void
  1324. X  populate()
  1325. X  {
  1326. X!     int    i=0,x=0,y=0,j=0,xloc,yloc,xpos,ypos;
  1327. X      int    nvynum=0,armynum=0,points,shipsize,temp,cnum;
  1328. X      short    short1,short2;            /*temporary short variables */
  1329. X      short    class;
  1330. X***************
  1331. X*** 747,753 ****
  1332. X      for( country=1; country<NTOTAL; country++ ) {
  1333. X          curntn = &ntn[country];
  1334. X          if( isactive( curntn->active )) {
  1335. X!             printf("THIS SHOULDNT HAPPEN\n");
  1336. X              continue;
  1337. X          }
  1338. X          strcpy(curntn->passwd,ntn[0].passwd);
  1339. X--- 848,854 ----
  1340. X      for( country=1; country<NTOTAL; country++ ) {
  1341. X          curntn = &ntn[country];
  1342. X          if( isactive( curntn->active )) {
  1343. X!             newerror("THIS SHOULDNT HAPPEN");
  1344. X              continue;
  1345. X          }
  1346. X          strcpy(curntn->passwd,ntn[0].passwd);
  1347. X***************
  1348. X*** 819,826 ****
  1349. X              } else    if(nnomads < MAXARM )    nnomads++;
  1350. X              break;
  1351. X      }
  1352. X!     printf("placing %d lizards, %d pirates, %d savages, and %d nomads\n",
  1353. X          nlizards,npirates,nbarbarians,nnomads);
  1354. X  
  1355. X      while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
  1356. X          if( nlizards>0 ) {
  1357. X--- 920,929 ----
  1358. X              } else    if(nnomads < MAXARM )    nnomads++;
  1359. X              break;
  1360. X      }
  1361. X!     mvprintw(13,0,"Placing %d lizards, %d pirates, %d savages, and %d nomads",
  1362. X          nlizards,npirates,nbarbarians,nnomads);
  1363. X+     clrtoeol();
  1364. X+     refresh();
  1365. X  
  1366. X      while((nlizards+npirates+nbarbarians+nnomads > 0 )&&(loopcnt++ <5000)) {
  1367. X          if( nlizards>0 ) {
  1368. X***************
  1369. X*** 987,1026 ****
  1370. X          }
  1371. X      }
  1372. X  
  1373. X!     printf("all random population and monsters placed\n");
  1374. X  #endif MONSTER
  1375. X  
  1376. X      for (i=0;i<MAXHELP;i++) {
  1377. X!     sprintf(fname,"%s/%s%d",DEFAULTDIR,helpfile,i);
  1378. X!     if ((fp=fopen(fname,"r"))==NULL) {
  1379. X!         printf("\tcannot find helpfile <%s>\n",fname);
  1380. X!         printf("\tplease move it to %s\n",DEFAULTDIR);
  1381. X      }
  1382. X-     }
  1383. X  
  1384. X  #ifdef NPC
  1385. X!     printf("\nDo you want NPC nations in this campaign? (y or n)");
  1386. X!     while( ((i=getchar()) != 'y')&&(i != 'n') ) ;
  1387. X!     if( i!='y' ) return;
  1388. X      if((fp=fopen(npcsfile,"r"))==NULL) {
  1389. X!         printf("error on read of %s file\n",npcsfile);
  1390. X!         printf("Do you wish to use default NPC nations file (y or n)?");
  1391. X          while( ((i=getchar()) != 'y')&&(i != 'n') ) ;
  1392. X          if( i=='y'){
  1393. X              sprintf(line,"%s/%s",DEFAULTDIR,npcsfile);
  1394. X              if ((fp=fopen(line,"r"))==NULL) {
  1395. X!                 printf("\nsorry; error on read of %s file\n",line);
  1396. X                  return;
  1397. X!             } else printf("\nOK; default nations used\n");
  1398. X          } else {
  1399. X!             printf("\nOK; no NPC nations used\n");
  1400. X              return;
  1401. X          }
  1402. X      }
  1403. X-     printf("reading npc nation data from file: %s\n",npcsfile);
  1404. X-     printf("and adding 1 nation per %d land sectors\n",NPC);
  1405. X  
  1406. X      cnum=1;
  1407. X      while(fgets(line,LINELTH,fp)!=NULL) {
  1408. X          /*read and parse a new line*/
  1409. X          if(line[0]!='#') {
  1410. X--- 1090,1138 ----
  1411. X          }
  1412. X      }
  1413. X  
  1414. X!     newerror("... All random population and monsters placed");
  1415. X  #endif MONSTER
  1416. X  
  1417. X      for (i=0;i<MAXHELP;i++) {
  1418. X!         sprintf(fname,"%s/%s%d",DEFAULTDIR,helpfile,i);
  1419. X!         if ((fp=fopen(fname,"r"))==NULL) {
  1420. X!             char tempc[BIGLTH];
  1421. X!             sprintf(tempc,"cannot find helpfile <%s/%s>.",DEFAULTDIR,fname);
  1422. X!             newerror(tempc);
  1423. X!         }
  1424. X      }
  1425. X  
  1426. X  #ifdef NPC
  1427. X!     mvaddstr(14,0,"Do you want NPC nations in this campaign? (y or n)");
  1428. X!     clrtoeol();
  1429. X!     refresh();
  1430. X!     while( ((i=getch()) != 'y')&&(i != 'n') ) ;
  1431. X!     if( i!='y' ) {
  1432. X!         newerror("OK; no NPC nations used");
  1433. X!         return;
  1434. X!     }
  1435. X      if((fp=fopen(npcsfile,"r"))==NULL) {
  1436. X!         mvaddstr(14,0,"Do you wish to use default NPC nations file (y or n)?");
  1437. X!         clrtoeol();
  1438. X!         refresh();
  1439. X          while( ((i=getchar()) != 'y')&&(i != 'n') ) ;
  1440. X          if( i=='y'){
  1441. X              sprintf(line,"%s/%s",DEFAULTDIR,npcsfile);
  1442. X              if ((fp=fopen(line,"r"))==NULL) {
  1443. X!                 newerror("Cannot read nation file... no NPCs added");
  1444. X                  return;
  1445. X!             } else newerror("OK; default nations used");
  1446. X          } else {
  1447. X!             newerror("OK; no NPC nations used");
  1448. X              return;
  1449. X          }
  1450. X      }
  1451. X  
  1452. X      cnum=1;
  1453. X+     mvprintw(14,0,"ADDING NATIONS:");
  1454. X+     refresh();
  1455. X+     xpos = 16;
  1456. X+     ypos = 14;
  1457. X      while(fgets(line,LINELTH,fp)!=NULL) {
  1458. X          /*read and parse a new line*/
  1459. X          if(line[0]!='#') {
  1460. X***************
  1461. X*** 1034,1049 ****
  1462. X  
  1463. X              country=cnum;
  1464. X              curntn = &ntn[country];
  1465. X              if( cnum > MAPX*MAPY/NPC*(100-pwater)/100 ) {
  1466. X!                 printf("world too small to add npc nation %d %s\n",cnum,curntn->name);
  1467. X                  continue;
  1468. X              } 
  1469. X              if( isactive(ntn[cnum].active) ) {
  1470. X!                 printf("Too few nations permitted in world to add npc nation %d %s\n",cnum,curntn->name);
  1471. X                  continue;
  1472. X              }
  1473. X-             curntn->class = (short)class;
  1474. X-             printf("adding npc nation %s (%s)\n",curntn->name,*(Class+curntn->class));
  1475. X              curntn->maxmove = short1;
  1476. X              curntn->repro = short2;
  1477. X              if( allign == 'G' )
  1478. X--- 1146,1170 ----
  1479. X  
  1480. X              country=cnum;
  1481. X              curntn = &ntn[country];
  1482. X+             curntn->class = (short)class;
  1483. X+             sprintf(line," %s (%s)",curntn->name,*(Class+curntn->class));
  1484. X+             mvaddstr(ypos,xpos,line);
  1485. X+             xpos += strlen(line);
  1486. X+             if (xpos > COLS-20) {
  1487. X+                 xpos = 5;
  1488. X+                 ypos++;
  1489. X+             }
  1490. X+             refresh();
  1491. X              if( cnum > MAPX*MAPY/NPC*(100-pwater)/100 ) {
  1492. X!                 sprintf(line,"World too small to add npc nation %d %s",cnum,curntn->name);
  1493. X!                 newerror(line);
  1494. X                  continue;
  1495. X              } 
  1496. X              if( isactive(ntn[cnum].active) ) {
  1497. X!                 sprintf(line,"Not enough available nations to add npc nation %d %s",cnum,curntn->name);
  1498. X!                 newerror(line);
  1499. X                  continue;
  1500. X              }
  1501. X              curntn->maxmove = short1;
  1502. X              curntn->repro = short2;
  1503. X              if( allign == 'G' )
  1504. X***************
  1505. X*** 1061,1067 ****
  1506. X              else if( allign == 'i' )
  1507. X                  curntn->active = ISOLATIONIST;
  1508. X              else {
  1509. X!                 printf("invalid nation allignment (%c) line is:\n\t%s\n",allign,line);
  1510. X                  abrt();
  1511. X              }
  1512. X              strcpy(curntn->passwd,ntn[0].passwd);
  1513. X--- 1182,1190 ----
  1514. X              else if( allign == 'i' )
  1515. X                  curntn->active = ISOLATIONIST;
  1516. X              else {
  1517. X!                 sprintf(line,"invalid nation alignment (%c)");
  1518. X!                 newerror(line);
  1519. X!                 newreset();
  1520. X                  abrt();
  1521. X              }
  1522. X              strcpy(curntn->passwd,ntn[0].passwd);
  1523. X***************
  1524. X*** 1069,1076 ****
  1525. X              points -= doclass( class, FALSE );
  1526. X              points -= startcost();
  1527. X              if(points < 10 ) {
  1528. X!                 printf("ERROR IN NATIONS FILE IN NATION %s\n",ntn[cnum].name);
  1529. X!                 printf("nation doesnt have enough points left for 10000 civilians\n");
  1530. X                  abrt();
  1531. X              }
  1532. X              curntn->tciv = 1000L * points;
  1533. X--- 1192,1199 ----
  1534. X              points -= doclass( class, FALSE );
  1535. X              points -= startcost();
  1536. X              if(points < 10 ) {
  1537. X!                 newerror("ERROR: nation doesn't have enough points left for 10000 civilians");
  1538. X!                 newreset();
  1539. X                  abrt();
  1540. X              }
  1541. X              curntn->tciv = 1000L * points;
  1542. X***************
  1543. X*** 1100,1105 ****
  1544. X          }
  1545. X      }
  1546. X      att_base();    /* get nation attributes */
  1547. X!     printf("all npc nations placed\n");
  1548. X  #endif NPC
  1549. X  }
  1550. X--- 1223,1228 ----
  1551. X          }
  1552. X      }
  1553. X      att_base();    /* get nation attributes */
  1554. X!     newerror("All NPC nations placed");
  1555. X  #endif NPC
  1556. X  }
  1557. X*** oforms.c    Sun Aug  6 20:55:34 1989
  1558. X--- forms.c    Sun Aug  6 20:55:43 1989
  1559. X***************
  1560. X*** 13,18 ****
  1561. X--- 13,19 ----
  1562. X  /*    screen subroutines    */
  1563. X  
  1564. X  #include <ctype.h>
  1565. X+ #include <pwd.h>
  1566. X  #include "header.h"
  1567. X  #include "data.h"
  1568. X  
  1569. X***************
  1570. X*** 62,72 ****
  1571. X--- 63,83 ----
  1572. X                      mvaddstr(ypos+4,0,"class:");
  1573. X                      mvaddstr(ypos+5,0,"alignment:");
  1574. X                      mvaddstr(ypos+6,0,"score:");
  1575. X+ #ifdef NOSCORE
  1576. X+                     mvaddstr(ypos+7,0,"npc nation:");
  1577. X+                     if (country==0) {
  1578. X+                         mvaddstr(ypos+8,0,"talons:");
  1579. X+                         mvaddstr(ypos+9,0,"military:");
  1580. X+                         mvaddstr(ypos+10,0,"civilians:");
  1581. X+                         mvaddstr(ypos+11,0,"sectors:");
  1582. X+                     }
  1583. X+ #else
  1584. X                      mvaddstr(ypos+7,0,"talons:");
  1585. X                      mvaddstr(ypos+8,0,"military:");
  1586. X                      mvaddstr(ypos+9,0,"civilians:");
  1587. X                      mvaddstr(ypos+10,0,"sectors:");
  1588. X                      mvaddstr(ypos+11,0,"npc nation:");
  1589. X+ #endif /* NOSCORE */
  1590. X                  }
  1591. X  
  1592. X                  /* display nation information */
  1593. X***************
  1594. X*** 79,86 ****
  1595. X                      if(ntn[nationid].race==*(races+i)[0])
  1596. X                          mvprintw(ypos+3,xpos,"%s",*(races+i));
  1597. X                  mvprintw(ypos+4,xpos,"%s",*(Class+ntn[nationid].class));
  1598. X!                 mvprintw(ypos+5,xpos,"%s",allignment[npctype(ntn[nationid].active)]);
  1599. X                  mvprintw(ypos+6,xpos,"%ld",ntn[nationid].score);
  1600. X                  mvprintw(ypos+7,xpos,"%ld",ntn[nationid].tgold);
  1601. X                  mvprintw(ypos+8,xpos,"%ld",ntn[nationid].tmil);
  1602. X                  mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tciv);
  1603. X--- 90,108 ----
  1604. X                      if(ntn[nationid].race==*(races+i)[0])
  1605. X                          mvprintw(ypos+3,xpos,"%s",*(races+i));
  1606. X                  mvprintw(ypos+4,xpos,"%s",*(Class+ntn[nationid].class));
  1607. X!                 mvprintw(ypos+5,xpos,"%s",alignment[npctype(ntn[nationid].active)]);
  1608. X                  mvprintw(ypos+6,xpos,"%ld",ntn[nationid].score);
  1609. X+ #ifdef NOSCORE
  1610. X+                 if(isnpc(ntn[nationid].active))
  1611. X+                     mvprintw(ypos+7,xpos,"Yes");
  1612. X+                 else mvprintw(ypos+7,xpos,"No");
  1613. X+                 if (country==0) {
  1614. X+                     mvprintw(ypos+8,xpos,"%ld",ntn[nationid].tgold);
  1615. X+                     mvprintw(ypos+9,xpos,"%ld",ntn[nationid].tmil);
  1616. SHAR_EOF
  1617. echo "End of part 1, continue with part 2"
  1618. echo "2" > s2_seq_.tmp
  1619. exit 0
  1620.